package com.wsh.crawler.constant;


import lombok.Getter;
import lombok.ToString;

import java.util.Objects;

/**
 * 语言枚举
 */
@Getter
@ToString
public enum LanguageEnum {

    ZH("zh", "简体中文"),

    IT("it", "意大利语"),

    FR("fr", "法语"),

    EN("en", "英文");

    private final String value;
    private final String description;

    LanguageEnum(String value, String description) {
        this.value = value;
        this.description = description;
    }

    public static LanguageEnum fromValue(String value) {
        for (LanguageEnum type : values()) {
            if (Objects.equals(type.value, value)) {
                return type;
            }
        }
        return null;
    }

}
